package com.example.demo.config;

import com.study.mongodbdynamicdatasource.config.IMongoDatabaseFactoryLoader;
import com.study.mongodbdynamicdatasource.config.MongoList;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Name:           config
 * @Description:    java类作用描述
 * @Author:         yn
 * @CreateDate:     2023/7/21 10:39
 * @Remark:         特殊说明
 * @Version:        1.0
 */
@Component
public class DefaultMongoDbFactoryLoader implements IMongoDatabaseFactoryLoader {
	/**
	 * 获取MongoDatabaseFactory
	 *
	 * @return Mongo数据源列表
	 */
	@Override
	public List<MongoList> loadMongoClientDbFactory() {
		ArrayList<MongoList> mongoLists = new ArrayList<>();
		mongoLists.add(MongoList.builder().uri("mongodb://127.0.0.1:27017/wangsheng").database("000").build());
		return mongoLists;
	}
}
